<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>

	<h2 class="page-header" style="margin-top: 20px;">类别管理</h2>

	<!-- 搜索 -->
	<form action="#" style="margin-bottom: 10px;">

		<div class="row">
			<div class="col-sm-6 col-xs-6">
				<input type="text" class="form-control" placeholder="商品类型">
			</div>
			
			<div class="col-sm-6 col-xs-6">
				<button class="btn  btn-primary " type="submit">搜索</button>

				<%--<button class="btn  btn-info " >新建分类</button>--%>
			</div>
		</div>
	</form>
	<div class="table-responsive">
		<table class="table table-striped">
			<thead>
				<tr>
					<th>序号</th>
					<th>商品类型</th>
					<th>商品图片</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
			<c:forEach items="${type_lists}" var="type" varStatus="status">
				<tr>
					<td>${status.index+1}</td>
					<td>${type.type_name}</td>
					<td width="30%"><img src="${type.type_img}" alt="图片" width="50px"> </td>

					<td>
						<a data-toggle="modal" data-target="#newModal"
						   onclick="value_t(${type.type_id},'${type.type_name}')" style="text-decoration: none;">修改</a>

							<%--<a onclick="delete_type(${type.type_id})" style="text-decoration: none;">删除</a></td>--%>
					</td>
				</tr>
			</c:forEach>
			</tbody>
		</table>
	</div>

	<!-- 模态框（Modal） -->
	<div class="modal fade" id="newModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×
					</button>
					<h4 class="modal-title" id="myModalLabel">
						类型修改
					</h4>
				</div>
				<div class="modal-body">
					<input type="hidden" id="typeid_t" name="typeid_t" value="">

					<div class="form-group">
						<label>商品类型</label>
						<input type="text" name="type_name" class="form-control" id="type_name" value="">
					</div>

				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">
						关闭
					</button>
					<button type="button" class="btn btn-primary" onclick="modify_type()">
						提交更改
					</button>
				</div>
			</div><!-- /.modal-content -->
		</div><!-- /.modal-dialog -->
	</div><!-- /.modal -->
</body>
</html>